using System;

using GURUCORE.Framework.Core;
using GURUCORE.Framework.Core.Data;
using GURUCORE.Framework.DataAccess.ORMapping;
using GURUCORE.Framework.DataAccess.ORMapping.CriteriaMapping;

namespace GURUCORE.Framework.DataAccess.DataSource
{
	public abstract class AbstractDataSource : TransactionManager
	{
		public AbstractDataSource()
		{
		}

		public abstract DTO GetObject(Type p_tObjectType, int p_nObjectID, params string[] p_arrColumns);
		public abstract DTO GetObject(Type p_tObjectType, int p_nObjectID, Transaction p_oTransaction, params string[] p_arrColumns);
		public abstract DTO GetObject(Type p_tObjectType, string p_sKeyColumn, int p_nObjectID, params string[] p_arrColumns);
		public abstract DTO GetObject(Type p_tObjectType, string p_sKeyColumn, int p_nObjectID, Transaction p_oTransaction, params string[] p_arrColumns);

		public abstract DTOCollection GetObjects(Type p_tObjectType, Criteria p_oCriteria, params string[] p_arrColumns);
		public abstract DTOCollection GetObjects(Type p_tObjectType, Criteria p_oCriteria, Transaction p_oTransaction, params string[] p_arrColumns);

		public abstract DTO AddObject(Type p_tObjectType, DTO p_oDTO);
		public abstract DTO AddObject(Type p_tObjectType, DTO p_oDTO, Transaction p_oTransaction);

		public abstract int DeleteObject(Type p_tObjectType, int p_nObjectID);
		public abstract int DeleteObject(Type p_tObjectType, int p_nObjectID, Transaction p_oTransaction);

		public abstract int DeleteObjects(Type p_tObjectType, Criteria p_oCriteria);
		public abstract int DeleteObjects(Type p_tObjectType, Criteria p_oCriteria, Transaction p_oTransaction);

		public abstract int SaveObject(Type p_tObjectType, DTO p_oDTO);
		public abstract int SaveObject(Type p_tObjectType, DTO p_oDTO, Transaction p_oTransaction);
		
		public abstract int SetFieldNull(Type p_tObjectType, DTO p_oDTO, params string[] p_arrColumns);
		public abstract int SetFieldNull(Type p_tObjectType, DTO p_oDTO, Transaction p_oTransaction, params string[] p_arrColumns);

		public abstract int GetCount(Type p_tObjectType, Criteria p_oCriteria);
		public abstract int GetCount(Type p_tObjectType, Criteria p_oCriteria, Transaction p_oTransaction);
	}
}
